﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master" AutoEventWireup="true" CodeBehind="Detail.aspx.cs" Inherits="Indochinaodyssey.Admin.Detail" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            font-size: large;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <div>
            <asp:Panel ID="pnInfo" runat="server" CssClass="pnInfo" Visible="False">
                <fieldset>
                    <legend>
                        <asp:Label ID="lblInfo" runat="server" Text="Thông tin nội dung tour"></asp:Label>
                    </legend>
                    <div>
                        <table width="100%">
                            <tr>
                                <td class="leftInfo">
                                    Loại</td>
                                <td >
                                    <asp:DropDownList ID="ddlLoai" runat="server" DataSourceID="odsTypeDetail" 
                                        DataTextField="TieuDe" DataValueField="Id" Width="300px">
                                    </asp:DropDownList>
                                    <asp:ObjectDataSource ID="odsTypeDetail" runat="server" DeleteMethod="Delete" 
                                        SelectMethod="GetAll" TypeName="IOBusiness.clsBSTypeDetail">
                                        <DeleteParameters>
                                            <asp:Parameter Name="id" Type="Int32" />
                                        </DeleteParameters>
                                    </asp:ObjectDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    Nội dung</td>
                                <td >
                                    <FCKeditorV2:FCKeditor ID="txtNoiDung" runat="server" Height="600px">
                                    </FCKeditorV2:FCKeditor>
                                </td>
                            </tr>
                            <tr>
                                <td class="leftInfo">
                                    <%--<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                                    </asp:ToolkitScriptManager>--%>
                                    <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server">
                                    </asp:ToolkitScriptManager>
                                </td>
                                <td >
                                    <asp:Button ID="btnSave" runat="server" onclick="btnSave_Click" Text="Lưu" />
                                    &nbsp;
                                    <asp:Button ID="btnCancel" runat="server" 
                                        Text="Hủy" CausesValidation="False" onclick="btnCancel_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </fieldset>
            </asp:Panel>
        </div>
        <div>
            <table width="100%" >
                <tr>
                    <td >
                        <span class="style1"><strong>Quản lý nội dung tour</strong></span><asp:ObjectDataSource ID="odsDetail" runat="server" 
                            SelectMethod="GetByTour" TypeName="IOBusiness.clsBSDetail" 
                            DataObjectTypeName="IOEntity.clsDetail" DeleteMethod="Delete" 
                            InsertMethod="Insert" UpdateMethod="Update">
                            <DeleteParameters>
                                <asp:Parameter Name="id" Type="Int32" />
                            </DeleteParameters>
                            <SelectParameters>
                                <asp:QueryStringParameter Name="tourid" QueryStringField="tourid" 
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            SelectCommand="SELECT dbo.tblDetail.ID, dbo.tblTypeDetail.TieuDe, dbo.tblTypeDetail.STT FROM dbo.tblTypeDetail INNER JOIN dbo.tblDetail ON dbo.tblTypeDetail.ID = dbo.tblDetail.TypeDetailID WHERE (dbo.tblDetail.TourID = @tour)">
                            <SelectParameters>
                                <asp:QueryStringParameter Name="tour" QueryStringField="tourid" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </td>
                    <td align="right">
                        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                            Text="Thêm mới" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" 
                            ForeColor="#333333" GridLines="None" Width="100%" 
                            onrowcommand="GridView1_RowCommand">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:BoundField DataField="Id" HeaderText="Mã" SortExpression="Id" >
                                <ItemStyle Width="60px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="TieuDe" HeaderText="TieuDe" SortExpression="TieuDe">
                                </asp:BoundField>
                                <asp:BoundField DataField="STT" HeaderText="STT" SortExpression="STT">
                                <ItemStyle Width="60px" />
                                </asp:BoundField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton2" runat="server" 
                                            CommandArgument='<%# Eval("Id") %>' CommandName="sua">Sửa</asp:LinkButton>
                                        &nbsp;-
                                        <asp:LinkButton ID="lbtnXoa" runat="server" 
                                            onclientclick="return confirm('Bạn có muốn xóa không?')" 
                                            CommandArgument='<%# Eval("Id") %>' CommandName="Xoa">Xóa</asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Width="100px" />
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#E9E7E2" />
                            <SortedAscendingHeaderStyle BackColor="#506C8C" />
                            <SortedDescendingCellStyle BackColor="#FFFDF8" />
                            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </div>
        <br />
    </div>
</asp:Content>
